//
import { createRouter, createWebHistory } from "vue-router";
import routes from "./routers";

const router = createRouter({
  //history: createWebHashHistory(),
  history: createWebHistory(process.env.BASE_URL),
  routes,
});
// 路由拦截器 - 前置拦截
router.beforeEach((to) => {
  document.title = "生成网站标题"; //to.meta.web_title;//生成网站标题
  if (to.name == undefined) {
    router.push("/404");
  }
});
export default router;
